package com.nd.qa.shareplate;

public class GetMethodName {

	public static void main(String[] args) { 
		GetMethodName methodName = new GetMethodName();   
		  String clazz = Thread.currentThread() .getStackTrace()[1].getClassName();
		String method = Thread.currentThread() .getStackTrace()[1].getMethodName();
		System.out.println("class name: " + clazz + " Method Name " + method); 
		  methodName.anotherMethod(); 
	}   
	private void anotherMethod() { 
		  String clazz = this.getClass().getName(); 
		  String method = Thread.currentThread() .getStackTrace()[1].getMethodName(); 
		  System.out.println("class name: " + clazz + " Method Name " + method);   
	} 
}
